{extend name="mainadmin@layouts/base" /}
{block name="head"}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
{/block}
{block name="main" }

<header class="header  b-b clearfix">
<form id="forms" method="post" action="{:url('index')}" >
     <div class="page-breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>属性列表</strong>
                </li>                                  
            </ul>
            <select name="model_id"  style="width:150px;" data-toggle="select2" data-chang="submit">
                  {volist name="listOpt" id="opt" }
                  	<option value="{$opt.id}" {$model_id==$opt['id']?'selected':''}>{$opt.name}</option>
                  {/volist}
            </select>
            <a class="text-muted pull-right pointer p-r m-t-md" data-toggle="back" title="返回"><i class="fa fa-reply"></i></a>
            <a href="{:url('info',array('model_id'=>$model_id))}" data-toggle="ajaxModal" title="添加属性" class="btn btn-sm btn-default fr m-t-md m-r-tm"><i class="fa fa-plus m-r-xs"></i>添加属性</a>
        </div>
</header>

<section class="scrollable wrapper">
    <section class="panel panel-default ">
        <div class="table-responsive " >
            <table id="listTable" class="table table-hover dataTable">
<thead>
<tr>
    <th width="150">所属类型</th>
    <th width="150">属性名称</th>
    <th width="120">录入方式</th>
    <th>可选值列表</th>
    <th width="90" style="text-align:center;">排序</th>
    <th width="150" style="text-align:center;">操作</th>
</tr>
</thead>
<tbody>
{volist name="list" id="vo" }
  <tr>
        <td>{$listOpt[$vo['model_id']]['name']}</td>
        <td>{$vo.attr_name}</td>
        <td>{$attr_input_type[$vo['attr_input_type']]}</td>
        <td>{$vo.attr_values}</td>
        <td align="center"><span data-toggle="ajaxEditInput" data-field="sort_order" data-url="{:url('ajaxEdit',array('attr_id'=>$vo['attr_id']))}" >{$vo.sort_order|intval}</span></td>
        <td align="center">
        	<a  href="javascript:;" data-remote="{:url('info',array('attr_id'=>$vo['attr_id']))}" data-toggle="ajaxModal" title="编辑" class="fa fa-edit m-xs" ></a>
   			<a href="{:url('del',array('attr_id'=>$vo['attr_id']))}" data-toggle="ajaxRemove" data-msg="确定删除 {$vo.attr_name}"  class="fa fa-trash"  title="删除"></a>
        </td>
    </tr>
{/volist}
{empty name="list"}
<tr>
    <td height="200" colspan="24" valign="middle" style="text-align:center;">没有找到相关数据!</td>
</tr>
{/empty}
</tbody>
</table>
      
        </div>
    </section>
</section>
{/block}
